package ae.pcfc.cldos.online.common.dao;

import org.hibernate.SessionFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;

/**
 * This is a BASE DAO Class which is the parent class of Generic DAO, and the dependecies
 * will be injected via XML IOC.
 * 
 * @author arosa
 * @Reviewed By Ammar
 * @Date 25-Jan-2012
 */
public abstract class BaseDAO {
	
	protected HibernateTemplate hibernateTemplate;
	protected JdbcTemplate jdbcTemplate;

	protected SessionFactory factory;
	
	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}

	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
		if(hibernateTemplate!=null){
			factory = hibernateTemplate.getSessionFactory();
		}
	}
	/**
	 * @return the jdbcTemplate
	 */
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	/**
	 * @param jdbcTemplate the jdbcTemplate to set
	 */
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

}
